from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, text, func, DateTime
from sqlalchemy.dialects.mysql import INTEGER

__all__ = ["Base", "TimestampMixinModel"]

# 数据库模型基类
Base = declarative_base()


class TimestampMixinModel:
    created_time = Column(
        DateTime,
        nullable=False,
        default=func.now(),
        comment="创建时间",
    )
    updated_time = Column(
        DateTime,
        nullable=False,
        onupdate=func.now(),
        comment="更新时间",
    )
    deleted_time = Column(
        DateTime,
        nullable=False,
        comment="删除时间",
    )
